<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<jsp:directive.page import="com.anhry.app.safety.manage.system.bean.TbSysFun"/>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>左侧菜单树</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/style.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath %>/js/menutree/dtree.js"></script>
	<style type="text/css">
		body {margin:0px;padding:0px;width:100%;height:100%;max-height:100%;overflow: hidden;font-size:12px; background:#fff;}
		* html body {padding-top:30px; font-size:12px;}
		a{font-size:12px;}
	</style>
	<script type="text/javascript"  >
	var d;
		function openall(){
		if(d ) {
			d.openAll();
			}
			//parent.window.golist2(flag);
		}
		function init(){
			<% 
				if(request.getParameter("rightgo")!=null){
					String rightgo = request.getParameter("rightgo").toString();
					if(!rightgo.equals("1")){
					%> 
						document.form1.submit();
					<%
					}
				}else{
					%> 
						document.form1.submit();
					<%
				}
			%>
		}
	</script>
  </head>
  
  <body onload="init();">
  
    <div id="left" style="height:100%; padding-top:0px;margin-top:0px;">
	  <div class="left_title">
	   	<s:if test="%{fun==null}">
    	 	首 页
    	</s:if>
    	<s:else>
   		 	${fun.funName}
   		</s:else>
	  </div>
	<div id="container" >
	      <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
		   <tr>
		    <td valign="top">
			    <s:if test="%{funList.size>0}">
			    	<div class="dtree">
			      		<span><a href="javascript: d.openAll();">全部展开</a> | <a href="javascript: d.closeAll();">全部收起</a></span>
			     	</div>
			     	<script type="text/javascript">
						<!--
						 d = new dTree('d','<%=basePath%>');
						
						<%
							List menuList = (List)request.getAttribute("funList");
							for(int i=0;i<menuList.size();i++){
								TbSysFun menu = (TbSysFun)menuList.get(i);				
						%>		    						
						   d.add(<%=menu.getId()%>,<%=menu.getFunParentId()%>,'<%=menu.getFunName()%>','<%=menu.getFunUrl()%>','null','<%=menu.getFunTarget()%>','','');   
						<%			
						}
						%>
						document.write(d);
						//-->
					</script>
					<s:if test="%{fun.funUrl!=null}">
						<form action="<%=basePath%>${fun.funUrl}" method="post" name="form1" target="rightFrame">
							<input type="hidden" name="menuName" id="menuName" value="${fun.funName}">
						</form>
					</s:if>
					<s:else>
						<form action="<%=basePath%>/welcome.jsp" method="post" name="form1" target="rightFrame">
					    	<input type="hidden" name="menuName" id="menuName" value="${fun.funName}">
					    </form>
					</s:else>
			     </s:if>	
			     <s:else>
			     	<form action="<%=basePath%>/admin/wel.action" method="post" name="form1" target="rightFrame">
			    		<input type="hidden" name="menuName" id="menuName" value="首 页">
			    	</form>
			     	<div class="tre_list">
			      		<li><img src="<%=basePath+Util.SKIN%>/images/house.gif"><a href="<%=basePath%>/admin/index_left.action" target="rightFrame">首 页</a></li>
			      		<!--  
			      		<li><img src="<%=basePath+Util.SKIN%>/images/house.gif"><a href="#" target="rightFrame">系统帮助</a></li>
			      		-->
		     		</div>
			     </s:else>
		     </td>
		   </tr>
		  </table>
	  </div>
	</div>
  </body>
</html>
